﻿@{
        ViewBag.Title = "MemLoan";
        Layout = "~/Views/Shared/MyAccount.cshtml";
    }
<link href="~/Content/BootstrapSouce/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/Content/BootstrapSouce/js/jquery.js"></script>
<script src="~/Content/BootstrapSouce/js/bootstrap.min.js"></script>
<script>
    $(document).ready(function () {
        $.ajax({
            type:"POST",
            url: "/MemLoan/UserrsSelect",
            dataType: "json",
            success: function (mes) {
                if (mes == 0) {
                    alert("请登录");
                    location.href = '/MyAccount/View_UserLogin'
                }
                else {
                    if (mes.UserMemlevelId > 0) {
                        $("#name").append(mes.UserName)
                    }
                    else {
                        alert('非VIP会员或已失效，不能进行自动投标设置、借款等业务，请先前往申请VIP页面操作。');
                        location.href = '#';
                    }
                };
                
            }
        });
    })
    function yan() {
        if ($("#pwd").val().length<6) {
            $("#yan").html("")
            $("#yan").html("密码至少6位！")
        }
        else if ($("#pwd").val().length >16)
            {
            $("#yan").html("")
            $("#yan").html("密码长度超出16位！")
        }
        else {
            $("#yan").html("")
            $("#yan").html("✔")
        }
    }
    function tijiao() {
        var pan = $("#yan").html();
        var PayPwd = $("#pwd").val();
        if ( pan=="✔") {
            $.ajax({
                type: "POST",
                url: "/MemLoan/SelectPayPwd",
                dataType: "json",
                success: function (mes) {
                    if (PayPwd==mes) {
                        location.href = "/MemLoan/MemLoanView";
                    }
                    else {
                        alert("支付密码不正确，请从新输入！");
                    }
                }
            });
        }
        else {
            alert('密码格式不正确');
            return;
        }
    }

       
</script>

<form>
    <div  style="width:900px; height:660px;">
        <h3 style="font-weight:bold;padding-left:300px;">当前操作需要验证您的交易密码！</h3><br />
        <div style="margin-left:20px;padding:0">
            <label>当前的用户名:</label>&nbsp; <label id="name" style="color:#ff0000"></label><br /><br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>交易密码:</label>&nbsp;&nbsp;<input id="pwd" type="password" onblur="yan()" placeholder="请输入交易密码" />&nbsp;<span id="yan" style="color:#ff0000"></span><br /><br />
            <input type="button" class="btn-primary" style="margin-left:70px;width:100px;height:35px; border-radius:5px;" value="确定继续" onclick="tijiao()"/>
        </div>
        <div style="margin-left:20px;padding:0;margin-top:120px;">
            <label>温馨提示：</label><br />
            <label>·交易密码必须6-16位数字、字母、下划线至少两种组成</label><br />
            <label>·如果交易密码太简单请<a href="/Memloan/UpdatePwd">修改交易密码</a></label>
        </div>
    </div>
</form>